// import { getAllRoleList, isAccountExist } from '@/api/demo/system';
import { BasicColumn, FormSchema } from '@/components/Table';
import { h } from 'vue';
import { useI18n } from "@/hooks/web/useI18n";

const { t } = useI18n();
export const columnsModels: BasicColumn[] = [
  {
    title: 'id',
    dataIndex: 'dataId',
    width: 50,
  },
  {
    title: '抖音用户名',
    dataIndex: 'username',
    width: 50,
  },
  {
    title: '抖音账号',
    dataIndex: 'userNo',
    width: 50,
  },
  {
    title: '地址',
    dataIndex: 'address',
    width: 50,
  },
  {
    title: t('sys.comment.columns.comment'),
    dataIndex: 'comment',
    width: 100,
  },
  {
    title: t('sys.informaionMatchaing.columns.url'),
    dataIndex: 'link',
    width: 50,
    customRender: ({ text, record }) => {
      return h(
        'a',
        {
          href: text,
          target: '_blank', // 在新标签页中打开链接
        },
        text,
      );
    },
  },
  {
    title: t('sys.informaionMatchaing.columns.matching'),
    dataIndex: 'matching',
    width: 50,
  },
];

export const columnsModelstabPeople: BasicColumn[] = [
  {
    title: t('sys.log.name'),
    dataIndex: 'title',
    width: 120,
  },
  {
    title: '视频链接',
    dataIndex: 'tag',
    width: 120,
  },
  {
    title: t('sys.informaionMatchaing.columns.title'),
    dataIndex: 'matching',
    width: 60,
  },
];
//私信表单
export const chatAccountFormSchema: FormSchema[] = [
  {
    field: 'title',
    label: '任务标题',
    component: 'Input',
    colProps: { span: 8 },
    defaultValue: '',
    rules: [{ required: true }],
  },
  {
    field: 'content',
    label: '私信内容',
    component: 'Input',
    colProps: { span: 8 },
    defaultValue: '',
    rules: [{ required: true }],
  },
];
export const searchFormSchemaDtail: FormSchema[] = [
  {
    field: 'matching',
    label: t('sys.informaionMatchaing.columns.matching'),
    component: 'Input',
    colProps: { span: 4 },
    defaultValue: '0.2',
  },
];
//表头数据
export const columns: BasicColumn[] = [
  {
    title: '任务id',
    dataIndex: 'id',
    width: 100,
  },
  {
    title: t('sys.informaionMatchaing.columns.createTime'),
    dataIndex: 'createTime',
    width: 100,
  },
  {
    title: '任务标题',
    dataIndex: 'title',
    width: 100,
  },
  {
    title: '私信内容',
    dataIndex: 'content',
    width: 100,
  },
  {
    title: t('sys.analysis.columns.status'),
    dataIndex: 'status',
    width: 100,
    customRender: ({ record }) => {
      if (record.status === 0) {
        return t('sys.configuration.notStart');
      } else if (record.status === 1) {
        return '进行中';
      } else {
        return '已完成';
      }
    },
  },
  {
    title: '已完成/总数',
    dataIndex: 'address',
    width: 100,
    customRender: ({ record }) => {
      return `${record.success}/${record.total}`;
    },
  },
];
//表头搜素数据
export const searchFormSchema: FormSchema[] = [
  {
    field: 'id',
    label: t('sys.informaionMatchaing.columns.createUsername'),
    component: 'Input',
    colProps: { span: 4 },
  },
  {
    field: 'nickname',
    label: t('sys.device.columns.time'),
    component: 'Input',
    colProps: { span: 4 },
  },
];
